#ifndef COMMANDUTIL_H
#define COMMANDUTIL_H

#include <QString>

class CommandUtil
{
public:
    static QString runCommand(const QString &commandLine, int timeout = 60 * 1000);
    static QString runCommand(const QString &program, const QStringList &params, int timeout = 60 * 1000);

    static void killProcessByName(const QString &name);

#ifdef Q_OS_LINUX
    // 在指定用户下运行指令
    static QString runCommandByUser(const QString &commandLine,const QString &userName, int timeout = 60 * 1000);

    // 获取当前用户总线路径
    static QString getSessionBusPath(const QString &userName);
#endif
};

#endif // COMMANDUTIL_H
